<template>
  <j-modal title="督办设置" :width="800" :visible="visible" switchFullscreen @cancel="handleCancel" @ok="handleOk">
    <div>
      <a-form-model
        ref="ruleForm"
        :model="form"
        :rules="rules"
        :label-col="labelCol"
        :wrapper-col="wrapperCol"
      >
        <a-form-model-item label="类别" prop="region">
          <j-search-select-tag
            v-model="form.region"
            :dictOptions="dictOptions"
            :placeholder="item.placeholder ? item.placeholder : '请选择' + item.label"
            :disabled="item.disabled"
            :class="item.class"
            :style="item.style"
            @change="handleInput(item.prop, $event)"
          />
        </a-form-model-item>
      </a-form-model>
    </div>
  </j-modal>
</template>
<script>


export default {
  name: 'AddModal',
  props:['data'],
  data() {
    return {
      visible:false,
      form:{},
      dictOptions:[
        {text:"SJSK-PC端",value:'1'},
        {text:"智慧禁毒APP",value:'2'},
        {text:"椰风送暖APP",value:'3'}
      ]
    }
  },
  async created() {
  },
  methods: {
    show() {
      this.visible = true
    },
    onStartChange() {

    },
    onChange(e) {
      // if (e.target.value == '2') {
      //   this.isPositive = true
      // } else {
      //   this.isPositive = false
      // }
      console.log('radio checked', e.target.value);
    },
    onSwitchChange(e) {
      console.log(e);
      if (e) {
        this.isPolice = true
      } else {
        this.isPolice = false
      }
    },
    handleCancel() {
      this.visible = false
      this.form = {}
    },
    handleOk() {
      if(this.data.supervisResult === 2){
        this.visible = false
      } else {
        putFile(this.data.id).then(ser => {
          if (ser.success){
            this.$message.success('归档成功');
            this.visible = false
            this.$emit('renovate')
          } else {
            this.$message.error('服务器反馈错误');
          }

        }).catch(err => {
          this.$message.error('浏览器反馈错误');
        })
      }
    }
  },
}
</script>
<style lang="less" scoped>
.l-form{
  display: flex;
  align-items: center;
  margin-top: -5px;
}
.display>*{
  margin: 5px;
}
</style>
